package com.app.designpatternslearn.behavior.mementopattern

import com.app.designpatternslearn.behavior.mementopattern.code.CareTaker
import com.app.designpatternslearn.behavior.mementopattern.code.Originator

fun main() {

    val careTaker = CareTaker()

    val originator = Originator()

    originator.state = "aaaa"

    careTaker.add(originator.saveStateToMemento())

    originator.state = "bbbb"

    careTaker.add(originator.saveStateToMemento())

    originator.getStateFromMemento(careTaker.get(0))

    println("$originator")
}